import Vue from 'vue'
import App from './App'
import store from './store'
// 挂在助手函数库
import $U from './common/util.js';
Vue.prototype.$U = $U
Vue.prototype.$store = store
Vue.config.productionTip = false
import divider from "./components/common/divider";
Vue.component("divider",divider);
import NoThing from './components/common/no-thing';
Vue.component('no-thing', NoThing);

App.mpType = 'app'

// 权限验证操作
Vue.prototype.checkAuth = (callback)=>{
	if(!store.state.userInfo){
		uni.showToast({
			title:"请先登录",
			icon:"none"
		});
		return uni.navigateTo({
			url:"/pages/login/login"
		})
	}
	callback()
}
// 权限验证跳转
Vue.prototype.navigateTo = (options)=>{
	if(!store.state.userInfo){
		uni.showToast({
			title:"请先登录",
			icon:"none"
		});
		return uni.navigateTo({
			url:"/pages/login/login"
		})
	}
	uni.navigateTo(options);
}

const app = new Vue({
    ...App,
	store
})
app.$mount()
